import socket
client=socket.socket()#实例化对象
client.connect(('localhost',9999))#连接服务器端
while True:
    msg=input(">>:").strip()#输入发送的信息
    if len(msg)==0:continue
    client.send(msg.encode('utf-8'))#发送信息
    data=client.recv(1024)
    print("recv:",data.decode())#打印接收的信息
    if data == "over":#如果服务器端返回的信息是"over"，退出循环
        break
client.close()#关闭连接